import { createSlice } from "@reduxjs/toolkit";

interface State {
    projectModalOpen: boolean
}
const initialState: State = {
    projectModalOpen: false
}

export const projectListSlice = createSlice({
    name: 'projectListSlice',
    initialState,
    reducers: { 
        openProjectModal: (state, action) => {
           state.projectModalOpen = true  //immer 可以允许直接修改state
        },
        closeProjectModal: (state, action) => {
           state.projectModalOpen = false
        }
    }
})

export const projectListActions = projectListSlice.actions